},
onCompleteScope: this
});
+
this._updateVisibility();
+ Shell.util_wake_up_screen();
}
},
obj.sourceBox.visible = obj.visible &&
(source.unseenCount > (obj.musicNotification ? 1 : 0));
+
this._updateVisibility();
+ if (obj.sourceBox.visible)
+ Shell.util_wake_up_screen();
},
_visibleChanged: function(source, obj) {
source.unseenCount > (obj.musicNotification ? 1 : 0);
this._updateVisibility();
+ if (obj.sourceBox.visible)
+ Shell.util_wake_up_screen();
},
_detailedChanged: function(source, obj) {
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdkx.h>
+#include <X11/extensions/XTest.h>
#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
#include <langinfo.h>
bits_per_sample, width, height, rowstride,
(GdkPixbufDestroyNotify) g_free, NULL);
}
+
+/**
+ * shell_util_wake_up_screen:
+ *
+ * Send a fake key event, resetting the IDLETIME counter and
+ * causing gnome-settings-daemon to wake up the screen.
+ */
+/* Shamelessly taken from gnome-settings-daemon/plugins/power/gpm-common.c */
+void
+shell_util_wake_up_screen (void)
+{
+ static gboolean inited = FALSE;
+ static KeyCode keycode1, keycode2;
+ static gboolean first_keycode = FALSE;
+
+ if (inited == FALSE) {
+ keycode1 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_KEY_Alt_L);
+ keycode2 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_KEY_Alt_R);
+ }
+
+ gdk_error_trap_push ();
+ /* send a left or right alt key; first press, then release */
+ XTestFakeKeyEvent (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), first_keycode ? keycode1 : keycode2, True, CurrentTime);
+ XTestFakeKeyEvent (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), first_keycode ? keycode1 : keycode2, False, CurrentTime);
+ first_keycode = !first_keycode;
+ gdk_error_trap_pop_ignored ();
+}